function register() {
	function back() {
		close();
		login();
	}
	
	function fullLengthTextField(name, fieldLabel) {
		return new Ext.form.TextField({ allowBlank: false, anchor: '97%', name: name, fieldLabel: fieldLabel });
	}
	
	function field(name, fieldLabel, inputType) {
		return { fieldLabel: fieldLabel, inputType: inputType, name: name };
	}
	
	function twoColumnedPanel(leftColumnItems, rightColumnItems, allowBlank) {
		return {
			baseCls: 'x-plain',
			defaults: {
				baseCls: 'x-plain',
				columnWidth: 0.5,
				defaults: { anchor: '94%', allowBlank: false || allowBlank },
				layout: 'form'
			},
			items: [
				{ defaultType: 'textfield',	items: leftColumnItems },
				{ defaultType: 'textfield', items: rightColumnItems }
			],
			layout: 'column'
		};
	}
	
	new Ext.Window({
		bbar: ['->', {
				handler: function() {
					submit(function() {
						Ext.Msg.show({
							buttons: Ext.MessageBox.OK,
							fn: back,
							icon: Ext.MessageBox.INFO,
							msg: '用户注册已成功 请等待审批',
							title: '信息'
						});
					});
				},
				text: '确定'
			},
			'-', { handler: reset, text: '重置' },
			'-', { handler: back,  text: '取消' }
		],
		closable: false,
		items: [
			new Ext.form.FormPanel({
				defaults: { autoHeight: true },
				defaultType: 'fieldset',
				items: [{
					items: [
						twoColumnedPanel(
							[ field('id', '用户名'), field('password', '密码', 'password') ], [
								Ext.apply(new Ext.form.ComboBox({
									mode: 'local',
									store: new Ext.data.SimpleStore({
										data: [ ['杭州'], ['宁波'], ['温州'], ['湖州'], ['嘉兴'], ['绍兴'], ['金华'], ['台州'], ['丽水'], ['衢州'], ['舟山'] ],
										fields: [ 'city' ]
									}),
									displayField: 'city'
								}), field('region', '地区')),
								field('confirm', '确认密码', 'password')
							]
						),
						fullLengthTextField('name',    '单位名称'),
						fullLengthTextField('address', '单位地址'),
						twoColumnedPanel(
							[ field('code', '企业代码'), field('representitive', '法定代表人'), field('phone', '电话') ],
							[ field('zip',  '邮政编码'), field('contact',        '工作联系人'), field('fax',   '传真') ]
						)
					],
					title: '必填信息'
				}, {
					items: [
						twoColumnedPanel(
							{ name: 'email', vtype: 'email', fieldLabel: 'E-Mail' },
							{ name: 'url',   vtype: 'url'  , fieldLabel: '网址' },
							true
						),
						new Ext.form.HtmlEditor({ anchor: '97% 60%', fieldLabel: '企业简介' })
					],
					title: '可选信息'
				}],
				labelWidth: 70,
				url: 'enterprises_register.action'
			})
		],
		title: '用户注册',
		width: 680
	}).show();
}
